package com.pz.cloud.framework.society.callback;

import com.pz.cloud.framework.business.society.entity.OrgSociety;
import com.pz.cloud.framework.business.society.service.IOrgSocietyService;
import com.pz.cloud.framework.business.workflow.model.BaseTaskCallback;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
@Slf4j
public class OrgSocietyCallback extends BaseTaskCallback<OrgSociety, IOrgSocietyService> {

    @Override
    public void callback(OrgSociety obj) {
        log.info("receive callback: {}", obj);
        if (processInfo.processEnd()) {
            obj.setBuildTime(new Date());
            service.save(obj);
        }
    }
}
